<template>
  <div class="page">
    Page is search
    <ul>
      <li v-for="(item,idx) in list"
          :key="idx">{{item}}</li>
    </ul>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data () {
    return {
      list: [],
    };
  },
  mounted: {},

  // asyncData是异步获取组件间的数据
  // fetch是获取vuex的数据
  async asyncData () {
    try{
    let { status, data } = await axios.get("https://discuz.chat/api/forum");
    console.log(data);
    // let {type} = data
    return {
      list: data,
    };
    } catch{
      console.log(e)
    }
  },
};
</script>

<style lang="css">
</style>

